package first.demo;
import java.util.Random;
import java.util.Scanner;
public class jisuan {
    public static void main(String[] args) {
        Random r = new Random();
        Scanner s = new Scanner(System.in);
        int a,b,result;
        a = r.nextInt(10);//一个随机数a
        b = r.nextInt(10);//一个随机数b
        result = a + b;
        System.out.printf("随机数a+b的值:%d+%d=?",a,b);
        System.out.println();
        System.out.print("输入你计算的值:");
        int num = s.nextInt();
        s.close();
        if(result == num)
            System.out.print("程序给出结果正确！");
        else
            System.out.print("error！");
    }
}
